package cn.tedu.oop;

public class TestConstructor2 {
    public static void main(String[] args) {

        Student s1 = new Student();
        System.out.println(s1.name);
        System.out.println(s1.gender);
        System.out.println(s1.major);
        System.out.println(s1.score);
        Student s2 = new Student("哈哈哈");
        System.out.println(s2.name);
        System.out.println(s2.gender);
        System.out.println(s2.major);
        System.out.println(s2.score);
        Student s3 = new Student("张三", '男', "抬杠", 100);
        System.out.println(s3.name);
        System.out.println(s3.gender);
        System.out.println(s3.major);
        System.out.println(s3.score);
    }
}
class Student{
    String name;
    char gender;
    String major;
    double score;

    public Student(String name, char gender, String major, double score) {
        this.name = name;
        this.gender = gender;
        this.major = major;
        this.score = score;
        System.out.println("我是student的全参构造");
    }

    public Student(){
        System.out.println("我是student的无参构造");
    }
    public Student(String n){
        System.out.println("我是student的含参构造" +n);
    }

}